package interview.algorithms.again_in_interview.concurrent;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author fance
 * @date 2018/8/22 17:20
 */
class Thread1 implements Runnable {
    @Override
    public void run() {
        System.out.println("test...");
        System.out.println(System.currentTimeMillis());
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
public class Test {
    public static void main(String[] args) {
        Thread1 thread1 = new Thread1();
        ExecutorService service =  Executors.newCachedThreadPool();
        for (int i = 0; i < 5; i++) {
            service.submit(thread1);
        }

    }
}
